<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh-CN"><head>
     <base href="<%=basePath%>"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico" tppabs="http://v3.bootcss.com/favicon.ico">

    <title>桌边零食-随时随地，想购就购~(～￣▽￣)～</title>

    <!-- Bootstrap core CSS -->
   <link href="shop/public/assets/bootstrap/css/bootstrap.min.css" tppabs="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
 <link rel="stylesheet" href="shop/public/css/custom.css">
    <!-- Custom styles for this template -->
    <link href="shop/public/css/dashboard.css" tppabs="http://v3.bootcss.com/examples/dashboard/dashboard.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js" tppabs="http://v3.bootcss.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="shop/public/assets/js/ie-emulation-modes-warning.js" tppabs="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="../../../cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js" tppabs="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="../../../cdn.bootcss.com/respond.js/1.4.2/respond.min.js" tppabs="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    
    <!-- -----------------------js---------------------------- -->
    <script>
    
    //按钮状态一
    function status1(){
    var test=document.getElementsByTagName("input");  
     var button=document.getElementById("button");
    
    
     
     test[1].readOnly=false;
     test[1].style.cssText=' ';
     
     test[2].readOnly=false;
     test[2].style.cssText=' ';
     
     test[3].readOnly=false;
     test[3].style.cssText=' ';
     
     test[4].readOnly=false;
     test[4].style.cssText=' ';
     
     test[5].readOnly=false;
     test[5].style.cssText=' ';
     
    
         
    }
    
    //按钮状态二
    function status2(){
    var test=document.getElementsByTagName("input");  
     var button=document.getElementById("button");
     test[1].readOnly=true;
     test[1].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[2].readOnly=true;
     test[2].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[3].readOnly=true;
     test[3].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[4].readOnly=true;
     test[4].style.cssText='background-color:#eeeeee;opacity:0.8; ';
     
     test[5].readOnly=true;
     test[5].style.cssText=' background-color:#eeeeee;opacity:0.8;';
     
     
    }
    
    
    //按钮双切换控制
    function Edit(){
          var btnE = document.getElementById("button"),text;
                text = btnE.innerText;
                btnE.innerText = text === "编辑" ? "取消":"编辑";
                text === "编辑" ? status1():status2();
      }
    
    
    </script>
    
  </head>

  <body  onload="isDisplayUser('<%=request.getSession().getAttribute("username") %>')"  background="public\assets\img\backgrounds\back.jpg" >

   <!--导航栏开始-->
			<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
				<div class="container-fluid">
					<!--导航头部(logo)-->
					<div class="navbar-header">
						<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"> 
		                	<span class="icon-bar"></span>
		                    <span class="icon-bar"></span>
		                    <span class="icon-bar"></span> 
	                    </button> 
	                    <a style="color:#f22e00" class="navbar-brand" href="<%=basePath%>index.jsp" ><i>桌边零食</i></a>
					</div>
					<!--导航列表-->
					<div id="navbar-collapse"  >
						<ul class="nav navbar-nav">
							<li class="active">
								<a class="head-a" href="<%=basePath%>index.jsp">首页 <span class="sr-only">(current)</span></a>
							</li>
							<!--用户订单记录(重要) 支付和未支付的-->
							<li class="dropdown">
								<a href="#" class="dropdown-toggle head-a" data-toggle="dropdown" role="button"><span style="color:#f22e00" class="glyphicon glyphicon-inbox"></span> 我的桌边 <span class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li><a href="#">已买到的零食</a></li><!--已支付已接收的订单-->
									<li class="divider"></li>
									<li><a href="#">最近购物</a></li> 
								</ul>
							</li>
							<!--购物车-->
							<li><a class="head-a" href="cartList?userid=<%=request.getSession().getAttribute("userid") %>&&page=1" ><span style="color:#f22e00" class="glyphicon glyphicon-shopping-cart"></span> 
							购物车 <span id="cartNum" ><%=request.getSession().getAttribute("cartNum") %></span></a>
							</li>
							<!--收藏夹-->
							<li><a class="head-a" href="showTheFav?userid=<%=request.getSession().getAttribute("userid") %>"  role="button" aria-expanded="true"><span style="color:#f22e00" class="glyphicon glyphicon-star"></span> 收藏夹 </a>
							</li>
							<li class="dropdown"><a class="head-a" href="#" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true"><span style="color:#f22e00" class="glyphicon glyphicon-th-list"></span> 网站导航 <span class="caret"></span></a>
								<ul class="dropdown-menu" role="menu">
									<li role="presentation" class="dropdown-header">休闲零食</li>
						            <li><a href="pageAction!showProductsPage.action?categoryName=坚果炒货&pageIndex=1">坚果炒货</a></li>
						            <li><a href="pageAction!showProductsPage.action?categoryName=梅/果干&pageIndex=1">梅/果干</a></li>
						            <li><a href="pageAction!showProductsPage.action?categoryName=糖果巧克力&pageIndex=1">糖果巧克力</a></li>
						            <li class="divider"></li>
						            <li role="presentation" class="dropdown-header">饼干糕点</li>
						            <!--自定义的菜单样式submenu-->
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">传统糕点  </a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=麻薯&pageIndex=1">麻薯</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=凤梨酥&pageIndex=1">凤梨酥</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=黄山烧饼&pageIndex=1">黄山烧饼</a></li>
						            	</ul>

						            </li>
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">西式糕点</a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=华夫饼&pageIndex=1">华夫饼</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=铜锣烧&pageIndex=1">铜锣烧</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=牛乳蛋糕&pageIndex=1">牛乳蛋糕</a></li>
						            	</ul> 
						            </li>
						            <li class="divider"></li>
						            <li role="presentation" class="dropdown-header">茶水饮料</li>
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">红茶</a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=正山小种&pageIndex=1">正山小种</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=祁门红茶&pageIndex=1">祁门红茶</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=川红&pageIndex=1">川红</a></li>
						            	</ul> 
						            </li>
						            <li class="dropdown-submenu">
						            	<a href="#"  class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="true">饮料</a>
						            	<ul class="dropdown-menu" role="menu">
						            		<li><a href="pageAction!showProductsPage.action?categoryName=碳酸饮料&pageIndex=1">碳酸饮料</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=即饮咖啡&pageIndex=1">即饮咖啡</a></li>
								            <li><a href="pageAction!showProductsPage.action?categoryName=果味饮料&pageIndex=1">果味饮料</a></li>
						            	</ul> 
						            </li>
						        </ul>
							</li>
						</ul> 
						<!--右边导航栏-->
						<ul class="nav navbar-nav navbar-right">
						
							<!--搜索零食-->
							<form class="navbar-form navbar-left" role="search" action="search">
								<div class="input-group">
									<input type="text" name="search" class="form-control" placeholder="零食传送门....">
									<span class="input-group-btn">
										<button class="btn btn-default" type="sumbit">
											<span style="color:#f22e00" class="glyphicon glyphicon-search"></span> 
											走起！
										</button>
									</span>
								</div>
							</form>
							
							<!--登录后修改为用户名-->
							<li><a class="head-a" id="userLogin" href="shop/Login.jsp"  style="color:#f22e00;display:display;">亲,请先登录!</a></li>
							<li class="dropdown">
								<a id="user" name="user.username" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" style="color:#f22e00;display:none;">
									<span><img/></span> 
									<%=request.getSession().getAttribute("username") %> 
									<span class="caret"></span>
								</a>
								<ul class="dropdown-menu" role="menu"> 
									<li><a href="shop/Setting.jsp">个人中心</a></li><!-- 用户设置 -->
									<li class="divider"></li>
									<li><a href="quit">退出</a></li><!--用户退出，清除cookie-->
								</ul>
							</li>
						</ul>
					</div>
				</div>
			</nav>
			<!--导航栏结束-->

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li ><a href="ShowSetting!showProfile.action">我的足迹<span class="sr-only">(current)</span></a></li>
            <li class="active"><a href="ShowProfile!showProfile.action">个人资料</a></li>
            <li><a href="ShowPasswordEdit!showProfile.action">密码修改</a></li>
           
          </ul>
        </div>
        
        
        <!------------------------------------------------------中间部分------------------------------->
		<div style="background-color:white;width:100%;height:720px;margin-top:0%;background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(237,237,235,1)); ">
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <h1 class="page-header">个人中心</h1>

          <div class="row placeholders">
            <div class="col-xs-6 col-sm-3 placeholder">
              <img data-src="holder.js/200x200/auto/sky" tppabs="http://v3.bootcss.com/examples/dashboard/holder.js/200x200/auto/sky" class="img-responsive" alt="200x200" src="" data-holder-rendered="true">
              <h4>用户头像</h4>
              <span class="text-muted">Something else</span>
            </div>
          
          <button id="button" onclick="Edit()">编辑</button>
          <form action="ShowProfile!updataProfile.action">         
           <p>用户名：<s:property value="user.username" /></p>         
           <p>邮箱：<s:property value="user.useremail"  /></p>
           <p>真实姓名：<input name="truename" style="background-color:#eeeeee;opacity:0.8;" value="<s:property value="profile.truename"/>" readOnly="true"/></p>
           <!-- <p>性别：<s:if test='profile.sex=="1"'>男</s:if><s:else>女</s:else>    </p> -->
           <p>昵称：<input name="nickname" style="background-color:#eeeeee;opacity:0.8;" value="<s:property value="profile.nickname"/>" readOnly="true"/></p>
           <p>年龄：<input name="age" style="background-color:#eeeeee;opacity:0.8;" value="<s:property value="profile.age"/>" readOnly="true"/></p>
           <p>电话：<input name="phone" style="background-color:#eeeeee;opacity:0.8;" value="<s:property value="profile.phone"/>" readOnly="true"/></p>
           <p>公司：<input name="company" style="background-color:#eeeeee;opacity:0.8;" value="<s:property value="profile.company"/>" readOnly="true"/></p>
           <input type="submit">
         </form>
          </div>

          
         
         </div>
        </div>
        <!------------------------------------------------------中间部分结束------------------------------->
        
        
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
   <script src="shop/public/assets/js/jquery-1.11.1.min.js"></script>
        <script src="shop/public/assets/bootstrap/js/bootstrap.min.js"></script> 
        <script src="shop/public/assets/js/retina-1.1.0.min.js"></script>
        <!--修改背景-->
        <script src="shop/public/assets/js/scripts.js"></script>
        <script src="shop/public/assets/js/jquery.backstretch.min.js"></script>  
     <script src="shop/public/assets/js/user.js"></script>
        <!-- 购物车 -->
        <script src="shop/public/assets/js/cart.js"></script>

<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200" preserveAspectRatio="none" style="visibility: hidden; position: absolute; top: -100%; left: -100%;"><defs></defs><text x="0" y="10" style="font-weight:bold;font-size:10pt;font-family:Arial, Helvetica, Open Sans, sans-serif;dominant-baseline:middle">200x200</text></svg></body></html>